<template>
	<view class="container">
		<!-- 背景图 -->
		<view class="background-image"></view>
		<!-- 按钮容器 -->
		<view class="button-container" v-if="showfenliu">
      <div class="first" @click="handleSecondClick">
        <div>
          <img src="../../../static/img/fenxiao/yingpin.png" alt="">
        </div>
        <div class="btm-btn">
          <div>
            应聘技师
          </div>
          <div>

          </div>
        </div>
      </div>
      <div class="second" style="margin-top: 200rpx" @click="handleFirstClick">
        <div>
          <img src="../../../static/img/fenxiao/fujin.png" alt="">
        </div>
        <div class="btm-btn">
          <div>
            附近技师
          </div>
          <div>

          </div>
        </div>
      </div>
		</view>
		<view class="button-container" v-else>
			<text>非有效分享</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 页面数据
				admin_id: -1,
				showfenliu: false //判断页面是否有效
			};
		},
		onLoad(option) {
			// 页面加载时执行
			var that = this
			if (option['admin_id']) {
				that.showfenliu = true
				that.admin_id = option['admin_id']
				uni.setStorageSync('father_id', that.admin_id)
			} else {
				that.showfenliu = false
			}
		},
		methods: {
			// 第一个按钮点击事件
			handleFirstClick() {
				uni.navigateTo({
					url: '/pages/service'
				})
			},
			// 第二个按钮点击事件
			handleSecondClick() {
				var that=this
				let url=`https://api.huixuananmm.com/coach/h5/?#/technician/pages/apply?admin_id=${that.admin_id}`;
				window.open(url)
			}
		}
	};
</script>

<style scoped>
	/* 页面容器，使内容居中 */
	.container {
    width: 100vw;
    background: linear-gradient( 160deg, #A5F1B2 0%, #D7FEBE 75%, #FAFAFA 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    .first, .second {
      .btm-btn {
        width: 304rpx;
        height: 82rpx;
        background: rgba(255,255,255,0.8);
        border-radius: 50rpx 50rpx 50rpx 50rpx;
        border: 2rpx solid #58C06E;
        margin-top: -60rpx;
        z-index: 10;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 400;
        font-size: 36rpx;
        color: #0A3D15;
      }
    }
	}
</style>